<include file="__THEME__/public_header"/>
<link href="__APP__/bitcoin.css" type="text/css" rel="stylesheet">

<div class="" style="margin-left: 100px;">
    <include file="_countdown"/>
</div>
<div class="" style="float: left;margin-left: 100px;">

    <include file="_nav"/>
</div>
<div class="sellB"style="float: left">
    <div class="wrap">
        <div class="box buyH">
            <div class="TitleBox">
                <h3 class="PlateTitle">卖出比特币</h3>
            </div>
            <div class="buyText clear">
                <span>建议价格：</span>
                <strong id="pricenice"> {$usd["return"]['last_all']["display_short"]}</strong>
            </div>
            <div class="buyText clear">
                <span><b class="importantB">*</b>卖出价格：</span>
                <input id="price" class="loginValue inputColor" type="text" value="{$usd_value}">
            </div>

            <div class="buyText clear">
                <span><b class="importantB">*</b>卖出数量：</span>
                <input id="number" class="loginValue" type="text" value="0">
            </div>
            <div class="buyText clear">
                <span>总价：</span> <strong class="CRed" id="sumprice"><input id="sum" type="text" value="0" style="background: none;border: 0"></strong>
            </div>
            <p class="prompt" id="trustmsg">您下的每笔单都会被系统处理，请您谨慎下单，不要重复下单。</p>
            <div class="buyBtn">
                <input class="inBtnA1" value="下单" type="button" id="trustbtcbtn" onclick="tbtcSubmit()">
            </div>
        </div>
    </div>
</div>

<div class="clear"></div>

<script>
    function tbtcSubmit(){
        $.post("{:U('bitcoin/Competition/deal')}",{type:1,price:parseFloat($('#price').val()), number: parseFloat($('#number').val())},
                function(data){
                if(data.status ==1){
                        alert("出售成功");}
                    else
                    {
                        alert("出售失败或比特币不足");
                    }
                },'json');
    }

    price=$('#price').val();
    number=0;
    sum =0;
    $(document).ready(function () {
        $('#price').change(function () {
            price=$('#price').val()
            add();
        });
        $('#number').change(function () {
            number=$('#number').val()
            add();
        });

        function add(){
            sum =price*number;
            $('#sum').val(sum);
        }
    });
</script>






<include file="__THEME__/public_footer"/>

